import Request from '@/utils/request'

export function getAllPermission(data) {
  return Request({
    url: '/api/admin/per/list/' + data,
    method: 'get'
  })
}

export function delPermission(data) {
  return Request({
    url: '/api/admin/per/del',
    method: 'post',
    data
  })
}

export function addPermission(data) {
  return Request({
    url: '/api/admin/per/add',
    method: 'post',
    data
  })
}

export function updatePermission(data, permissionId) {
  return Request({
    url: '/api/admin/per/update/' + permissionId,
    method: 'post',
    data
  })
}

export function findByParentId(parentId) {
  return Request({
    url: '/api/admin/per/list/' + parentId,
    method: 'get'
  })
}

export function findAll() {
  return Request({
    url: '/api/admin/per/list',
    method: 'get'
  })
}

export function getUserNotInRole(data) {
  return Request({
    url: '/api/admin/role/find/notUser',
    method: 'post',
    data
  })
}
